﻿using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;
using CustomsSystem.Model;
using CustomsSystem.DAL;

namespace CustomsSystem.BLL
{
    public class DocumentManage
    {
        public readonly DocumentService dal = new DocumentService();
        public bool Exists(string strWhere)
        {
            return dal.Exists(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// 
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        public DataSet GetList()
        {
            return dal.GetList(string.Empty);
        }
        public DataSet GetList1(string strwhere,string kai,string mo)
        {
            return dal.GetList1(strwhere,kai,mo);
        }
        public DataSet GetList2()
        {
            return dal.GetList2(string.Empty);
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CustomsSystem.Model.document GetModel(int sheetID)
        {
            return dal.GetModel(sheetID);
        }
        public CustomsSystem.Model.document GetModel(DataTable dt)
        {
            return dal.DataRowToModel(dt.Rows[0]);
        }
        /// <summary>
        /// 导出签收表excel
        /// </summary>
        /// <param name="strwhere"></param>
        /// <returns></returns>
        public DataSet GetView(string strwhere)
        {
            return dal.GetView(strwhere);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(CustomsSystem.Model.document model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CustomsSystem.Model.document model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int docID)
        {
            return dal.Delete(docID);
        }

        /// <summary>
        /// 下载数据
        /// </summary>
        /// <param name="sheetID"></param>
        /// <returns></returns>
        public CustomsSystem.Model.document GetModel1(int sheetID)
        {
            return dal.GetModel1(sheetID);
        }
    }
}
